\newcommand{\PdfPsText}[2]{
  \ifpdf
     #1
  \else
     #2
  \fi
}

%\newcommand{\IncludeGraphicsH}[3]{
%  \ifpdf
%  	\includegraphics[height=#2]{#1}%
%  \else
%  	\includegraphics[bb = #3, height=#2]{#1}%
% 	\fi
%}
%
%\newcommand{\IncludeGraphicsW}[3]{
%  \PdfPsText{\includegraphics[width=#2]{#1}}{\includegraphics[bb = #3, width=#2]{#1}}
%}

%\newcommand{\InsertFig}[3]{
%  \begin{figure}[!htbp]
%    \begin{center}
%      \leavevmode
%      #1
%      \caption{#3}
%      \label{#2}
%    \end{center}
%  \end{figure}
%}

% A couple of functions for marking things I need to check later
\newcommand{\revisit}[1]{\ifthenelse{\isnamedefined{draft}}{#1}{}}
\newcommand{\TODO}[1]{{\color{red}to do: #1}}
%\newcommand{\Check}[1]{{\color{BurntOrange} #1}}%\colorbox{yellow}{#1}}
\newcommand{\Check}[1]{\ifthenelse{\isnamedefined{draft}}{{\color{BurntOrange} #1}}{{#1}}}

% My own chapter command, defined so that I don't necessaryily get a new page for a new chapter
\newcommand{\Chapter}[1]{
		%\clearpage % put new chapters on a new page
    	\refstepcounter{chapter} % manually increment the chapter number
		% manually add the chapter to the table of contents
		\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter} #1}
		% and now format the header according to spec.
		
		%\vspace*{12pt}
		\begin{bf}
		\begin{flushleft}
		\large{\thechapter\ - #1}
		\end{flushleft}
		\end{bf}
		\vspace*{12pt}
		\chaptermark{#1}
}

% some functions for measurements
\newcommand{\unitspace}{\:}
\newcommand{\unit}[2]{$#1\unitspace\rm{#2}$}
\newcommand{\unitp}[3]{$#1\unitspace\rm{#2}^{#3}$}
\newcommand{\nm}[1]{\unit{#1}{nm}}
\newcommand{\nmp}[2]{\unitp{#1}{nm}{#2}}
\newcommand{\um}[1]{\unit{#1}{\mu m}}
\newcommand{\ump}[2]{\unitp{#1}{\mu m}{#2}}
\newcommand{\cm}[1]{\unit{#1}{cm}}
\newcommand{\cmp}[2]{\unitp{#1}{cm}{#2}}

% functions for referencing figures, tables etc
\newcommand{\figref}[1]{\figurename\ \ref{#1}}
\newcommand{\tabref}[1]{\tablename\ \ref{#1}}
\newcommand{\eqref}[1]{Equation \ref{#1}}


% some equation shorthands
\newcommand{\Del}{\nabla}
\newcommand{\Div}{\Del\cdot}
\newcommand{\Grad}{\Del}
\newcommand{\Curl}{\Del\times}
\newcommand{\X}[1]{{\mathbf #1}}
\newcommand{\E}{\X{E}}
\newcommand{\D}{\X{D}}
\newcommand{\B}{\X{B}}
\newcommand{\M}{\X{M}}
\newcommand{\w}{\omega}
\newcommand{\fn}[1]{\left(#1\right)}
\newcommand{\Ert}{\E\left(\X{r},t\right)}
\newcommand{\Drt}{\D\left(\X{r},t\right)}
\newcommand{\Brt}{\B\left(\X{r},t\right)}
\newcommand{\Xrt}[1]{\X{#1}\left(\X{r},t\right)}
\newcommand{\xrt}[1]{#1\left(\X{r},t\right)}
\newcommand{\partialdn}[3]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand{\partiald}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\partialdd}[2]{\partialdn{2}{#1}{#2}}
\newcommand{\e}{\rm{e}}
\newcommand{\hlf}{\frac{1}{2}}
\newcommand{\Xat}[6]{\left.{\rm #1}_{#2}\right|^{#3}_{#4,#5,#6}}
\newcommand{\Hat}[5]{\Xat{H}{#1}{#2}{#3}{#4}{#5}}
\newcommand{\Eat}[5]{\Xat{E}{#1}{#2}{#3}{#4}{#5}}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "~/Documents/LaTeX/CUEDThesisPSnPDF/thesis"
%%% End: 

\definecolor{grey}{rgb}{0.6,0.6,0.6}
\newcommand{\greylipsum}[1][1-7]{{\color{grey} \lipsum[#1]}}
\newcommand{\done}[1]{{\color{grey} $\sqrt{}$ #1}}